package com.itheima;

import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

public class LinkedHashedSetDemo {
    public static void main(String[] args) {
        LinkedHashSet<String> set=new LinkedHashSet<>();
        set.add("zhansan");
        set.add("lisi");
        set.add("wangwu");
        set.add("zhaoliu");

        Iterator<String>iterator= set.iterator();
        while(iterator.hasNext()){
            String next=iterator.next();
            System.out.println(next);
        }

    }
}
